<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core"  prefix="c"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>体育与健康课程管理系统</title>
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/public/css/common.css"/>
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/public/css/main.css"/>
    <link href="${pageContext.request.contextPath}/public/bootstrap/css/bootstrap.min.css" rel="stylesheet">
    <script type="text/javascript" src="${pageContext.request.contextPath}/public/js/libs/modernizr.min.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/public/js/jquery-3.2.1.min.js"></script>
    <script src="${pageContext.request.contextPath}/public/js/layer/layer.js"></script>
</head>
<body>
<p style="margin-top:15px;margin-left:40px; font-size:16px; border-left:3px #006dcc solid; padding-left:5px">查看体能测试成绩</p>
<div class="container clearfix" style="width:100%">
    <div class="main-wrap">
        <div class="search-wrap">
        	<div class="search-content">
        	<form action="${pageContext.request.contextPath}/petestscore/searchpetestscore.action" method="post">
        	 <table class="search-tab">
        	 	<th width="90" style="font-size:16px">学生姓名:</th>
        	 	<td><input type="text" class="common-text" style="height:32px" placeholder="学生姓名" name="userStudentInfoName" /></td>
        	 	 <td><button type="submit" class="btn btn-primary" onclick="">搜索</button></td>
        	 </form>
        	 
        	 <form action="${pageContext.request.contextPath}/petestscore/selectpetestscore.action" method="post">
        	 	<th width="150px" style="font-size:16px">选择分类:</th>
        	 	<td>
        	 	  <select name="userStudentInfoYear" style="width:120px;height:30px;border-radius:2%">
        	 	  <%if(session.getAttribute("userStudentInfoYear")!=null&&(int)session.getAttribute("userStudentInfoYear")!=0){%>
        	 		  <option value="<%=session.getAttribute("userStudentInfoYear") %>"><%=session.getAttribute("userStudentInfoYear") %></option><%} %>
         			<option value="0">全部年级</option>
                    <c:forEach items="${year }" var="x">
                     <option value="${x}">${x}级</option>
                    </c:forEach>
                  </select>
        	 	<select name="userStudentInfoCollege" style="width:120px;height:30px;border-radius:2%">
         		<%if(session.getAttribute("userStudentInfoCollege")!=null&&!session.getAttribute("userStudentInfoCollege").equals("0")){%>
        	 		  <option value="<%=session.getAttribute("userStudentInfoCollege") %>"><%=session.getAttribute("userStudentInfoCollege") %></option><%} %>
         			<option value="0">全部学院</option>
                    <c:forEach items="${college }" var="x">
                     <option value="${x}">${x }</option>
                    </c:forEach>
                  </select>
				</td>
				<td><input class="btn btn-primary btn2" name="sub" value="查询" type="submit"></td>
        	 </form>
        	 
        	<form action="${pageContext.request.contextPath}/petestscore/export.action" method="post" >
        	 	<th width="150px" style="font-size:16px">导出学生成绩:</th>
        	 	 <td>
        	 		<select name="name" style="width:120px;height:30px;border-radius:2%">
        	 		 	<option value="0">全部考试</option>
	                    <c:forEach items="${name }" var="x">
	                     <option value="${x.peTestId}">${x.peTestName}</option>
	                    </c:forEach>
        	 		</select>
        	 	</td>
        	 	<td>
        	 		<select name="userStudentInfoYear" style="width:120px;height:30px;border-radius:2%">
        	 		 	<option value="0">全部年级</option>
	                    <c:forEach items="${year }" var="x">
	                     <option value="${x}">${x}级</option>
	                    </c:forEach>
        	 		</select>
        	 	</td>
        	 	<td>
        	 		<select name="userStudentInfoCollege" style="width:120px;height:30px;border-radius:2%">
	         			<option value="0">全部学院</option>
	                    <c:forEach items="${college }" var="x">
	                     <option value="${x}">${x }</option>
	                    </c:forEach>        	 		
        	 		</select>
        	 	</td>
        	 	 <td><input class="btn btn-primary btn2" name="sub" value="导出成绩" type="submit"></td>
        	 </form>
        	 
        	 	</table>
        	</div>
        </div>
        <div class="result-wrap" >
               <div class="result-title">
                </div>
                <div class="result-content" id="app" >
                    <table class="result-tab" width="100%" id="addto">
                        <tr>
                        	<th>学年</th>
                        	<th>考试名称</th>
                            <th>学号</th>
                            <th>姓名</th>
                            <th>入学时间</th>
                            <th>所在学院</th>
                            <th>课程</th>
                            <th>课程代码</th>
                            <th>平时成绩</th>
                            <th>期末成绩</th>
                            <th>原始成绩</th>
                        </tr>
                      <c:forEach items="${data}" var="v">
                        <tr >
                        	<td>${date }</td>
                        	<td>${v.petest.peTestName}</td>
                            <td>${v.userStudentInfo.userStudentInfoNum}</td>
                           	<td>${v.userStudentInfo.userStudentInfoName }</td>
                         	<td>${v.userStudentInfo.userStudentInfoYear }</td>
                         	<td>${v.userStudentInfo.userStudentInfoCollege }</td>
                         	<td>体育知识测试</td>
                         	<td>${code}</td>
                         	<td>${v.peTestAppointmentUsual }</td>
                         	<td>${v.peTestAppointmentScore }</td>
                         	<td>${v.peTestAppointmentFinal }</td>
                            </tr>
  					</c:forEach>
                    </table>
                </div>
                </div>
               <div class="row">
				<div class="col-md-3">当前${page.pageNow}页,总${page.totalPageCount}
				页,总${page.totalCount}条记录</div>
                <div class="col-md-9">
				<nav aria-label="Page navigation">
				<%if(session.getAttribute("userStudentInfoYear") == null && session.getAttribute("userStudentInfoCollege") == null){ %>
				<ul class="pagination">
					<li><a href="${pageContext.request.contextPath}/petestscore/petestscore.action?pn=1">首页</a></li>
					<c:if test="${page.hasPre}">
						<li><a href="${pageContext.request.contextPath}/petestscore/petestscore.action?pn=${page.pageNow-1}"
							aria-label="Previous"> <span aria-hidden="true">&laquo;</span>
						</a></li>
					</c:if>
					<li class="active"><a href="#">${page.pageNow}</a></li>
					<c:if test="${page.pageNow<page.totalPageCount }">
						<li><a href="${pageContext.request.contextPath}/petestscore/petestscore.action?pn=${page.pageNow+1 }"
							aria-label="Next"> <span aria-hidden="true">&raquo;</span>
						</a></li>
					</c:if>
					<li><a href="${pageContext.request.contextPath}/petestscore/petestscore.action?pn=${page.totalPageCount}">末页</a></li>
				</ul>
				<%} else{ %>
					<ul class="pagination">
					<li><a href="${pageContext.request.contextPath}/petestscore/selectpetestscore.action?pn=1&userStudentInfoYear=<%=session.getAttribute("userStudentInfoYear") %>&userStudentInfoCollege=<%=session.getAttribute("userStudentInfoCollege") %>">首页</a></li>
					<c:if test="${page.hasPre}">
						<li><a href="${pageContext.request.contextPath}/petestscore/selectpetestscore.action?pn=${page.pageNow-1}&userStudentInfoYear=<%=session.getAttribute("userStudentInfoYear") %>&userStudentInfoCollege=<%=session.getAttribute("userStudentInfoCollege") %>"
							aria-label="Previous"> <span aria-hidden="true">&laquo;</span>
						</a></li>
					</c:if>
						<li class="active"><a href="#">${page.pageNow}</a></li>
					<c:if test="${page.pageNow<page.totalPageCount}">
						<li><a href="${pageContext.request.contextPath}/petestscore/selectpetestscore.action?pn=${page.pageNow+1}&userStudentInfoYear=<%=session.getAttribute("userStudentInfoYear") %>&userStudentInfoCollege=<%=session.getAttribute("userStudentInfoCollege") %>"
							aria-label="Next"> <span aria-hidden="true">&raquo;</span>
						</a></li>
					</c:if>
					<li><a href="${pageContext.request.contextPath}/petestscore/selectpetestscore.action?pn=${page.totalPageCount}&userStudentInfoYear=<%=session.getAttribute("userStudentInfoYear") %>&userStudentInfoCollege=<%=session.getAttribute("userStudentInfoCollege") %>">末页</a></li>
				</ul>
				
				<% 	session.removeAttribute("userStudentInfoYear");
					session.removeAttribute("userStudentInfoCollege");
				} %>
				</nav>
			</div>
			</div>

    </div>
</div>

</body>
</html>